﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpMap.Tools;
using SharpMap.Rendering.Rendering2D;
using SharpMap.Presentation.Views;
using System.ComponentModel;

namespace SharpMap.Presentation.Wpf
{
    public class WpfMapTool : MapTool<IMapView2D, Point2D>, INotifyPropertyChanged
    {
        public WpfMapTool(String name, Action<ActionContext<IMapView2D, Point2D>> queryAction,
        Action<ActionContext<IMapView2D, Point2D>> beginAction,
        Action<ActionContext<IMapView2D, Point2D>> extendAction,
        Action<ActionContext<IMapView2D, Point2D>> endAction)
            : base(name, queryAction, beginAction, extendAction, endAction)
        {
        }

        bool _isActive;
        public bool IsActive
        {
            get { return _isActive; }
            set { _isActive = value; RaisePropertyChanged("IsActive"); }
        }


        #region INotifyPropertyChanged Members
        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                PropertyChangedEventArgs args =
                    new PropertyChangedEventArgs(propertyName);
                handler(this, args);
            }
        }
        #endregion
    }
}
